home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / dev / c / cto.rea < prev    next >
Text File  |  1997-05-03  |  2KB  |  59 lines

  1. Short:    Converts a binary file to a linkable object
  2. Author:   jgeiss@muc.de (Johannes Geiss)
  3. Uploader: jgeiss@muc.de (Johannes Geiss)
  4. Type:     dev/c
  5.  
  6. Requires: Any C/Asm-linker
  7. Version:  1.4
  8.  
  9. This command (CTO) converts any binary file to an linkable object so
  10. you can link this binary data to your C/Asm-Code with any linker.
  11.  
  12. Example:
  13.  
  14. We have a binary file named "image.dat". It contains raw image data.
  15. And we have a compiled object file named "prg.o" which uses our
  16. raw datafield "image.dat".
  17.  
  18. We cannot link a raw binary file to an object file, so we have to convert
  19. the raw file first with CTO:
  20.  
  21.     CTO image.dat image.o _image_start _image_end -d
  22.  
  23. Now we'll get a linkable object file named "image.o". The label
  24. "_image_start" points to the beginning of the raw binary data and the
  25. label "_image_end" points to the end. Now you can access the image
  26. data in your program:
  27.  
  28. Asm:    xref _image_start
  29.     xref _image_end
  30.  
  31. C:    extern char *image_start;
  32.     extern char *image_end;
  33.  
  34. The switch "-d" converts the raw data to a HUNK_DATA and "-c" converts
  35. to a HUNK_CODE.
  36.  
  37.  
  38. Type "CTO ?" for more help.
  39.  
  40.  
  41. Some additional info:
  42.  
  43. CTO is fully written in assembly and it's quite a bit old (1993 :-)
  44. but I haven't the opportunity to upload to Aminet until now.
  45.  
  46. Have fun
  47. Johannes Geiss
  48.  
  49.  
  50. ============================= Archive contents =============================
  51.  
  52. Original  Packed Ratio    Date     Time    Name
  53. -------- ------- ----- --------- --------  -------------
  54.        0       0  0.0% 24-Apr-97 11:07:04 +
  55.     4884    2574 47.2% 19-Mar-00 22:41:26 +CTO
  56.     1273     632 50.3% 24-Apr-97 11:06:20 +CTO.readme
  57. -------- ------- ----- --------- --------
  58.     6157    3206 47.9% 24-Apr-97 16:09:48   3 files
  59.